using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VGWERT
    {
        public DataRow Convert2GWERT(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryGWERT(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["GWMANDANT"] = " ".PadRight(2 ); 
         dwReturn["GWPART"] = " ".PadRight(5 ); 
         dwReturn["GWLO"] = " ".PadRight(2 ); 
         dwReturn["GWBART"] = " ".PadRight(20 ); 
         dwReturn["GWBVAR"] = " ".PadRight(3 ); 
         dwReturn["GWBFARBE"] = " ".PadRight(10 ); 
         dwReturn["GWVART"] = " ".PadRight(20 ); 
         dwReturn["GWVVAR"] = " ".PadRight(3 ); 
         dwReturn["GWVFARBE"] = " ".PadRight(10 ); 
         dwReturn["GWEART"] = " ".PadRight(20 ); 
         dwReturn["GWEVAR"] = " ".PadRight(3 ); 
         dwReturn["GWEFARBE"] = " ".PadRight(10 ); 
         dwReturn["GWPRVH"] = " ".PadRight(0 ); 
         dwReturn["GWPRAK"] = " ".PadRight(0 ); 
         dwReturn["GWPRKU"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR1"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM1"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB1"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART1"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS1"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH1"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH1"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK1"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK1"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU1"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU1"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR2"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM2"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB2"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART2"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS2"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH2"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH2"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK2"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK2"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU2"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU2"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR3"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM3"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB3"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART3"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS3"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH3"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH3"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK3"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK3"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU3"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU3"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR4"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM4"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB4"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART4"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS4"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH4"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH4"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK4"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK4"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU4"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU4"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR5"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM5"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB5"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART5"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS5"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH5"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH5"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK5"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK5"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU5"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU5"] = " ".PadRight(0 ); 
         dwReturn["GWZENSUR6"] = " ".PadRight(1 ); 
         dwReturn["GWMRKM6"] = " ".PadRight(8 ); 
         dwReturn["GWZUAB6"] = " ".PadRight(1 ); 
         dwReturn["GWZUABART6"] = " ".PadRight(3 ); 
         dwReturn["GWBZGRS6"] = " ".PadRight(1 ); 
         dwReturn["GWAPKZVH6"] = " ".PadRight(1 ); 
         dwReturn["GWWERTVH6"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZAK6"] = " ".PadRight(1 ); 
         dwReturn["GWWERTAK6"] = " ".PadRight(0 ); 
         dwReturn["GWAPKZKU6"] = " ".PadRight(1 ); 
         dwReturn["GWWERTKU6"] = " ".PadRight(0 ); 
         dwReturn["GWAENDZL"] = " ".PadRight(0 ); 
         dwReturn["GWAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["GWAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["GWNEUBEN"] = " ".PadRight(8 ); 
         dwReturn["GWNEUDAT"] = " ".PadRight(0 ); 
         dwReturn["GWFILLER"] = " ".PadRight(40 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapGWERT(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveGWERT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryGWERT(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapGWERT(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertGWERT(dwLocal, ITXDBVERSION);
            }
            UpdateGWERT(dwLocal);
        }
        public void InsertGWERT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO GWERT(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryGWERT(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM GWERT WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM GWERT  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "GWERT";
            Return = Result;
            return Return;
        }
        public void DeleteGWERT(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM GWERT   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateGWERT(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE GWERT SET "
                    +"GWMANDANT= :GWMANDANT,"
                    +"GWPART= :GWPART,"
                    +"GWLO= :GWLO,"
                    +"GWBART= :GWBART,"
                    +"GWBVAR= :GWBVAR,"
                    +"GWBFARBE= :GWBFARBE,"
                    +"GWVART= :GWVART,"
                    +"GWVVAR= :GWVVAR,"
                    +"GWVFARBE= :GWVFARBE,"
                    +"GWEART= :GWEART,"
                    +"GWEVAR= :GWEVAR,"
                    +"GWEFARBE= :GWEFARBE,"
                    +"GWPRVH= :GWPRVH,"
                    +"GWPRAK= :GWPRAK,"
                    +"GWPRKU= :GWPRKU,"
                    +"GWZENSUR1= :GWZENSUR1,"
                    +"GWMRKM1= :GWMRKM1,"
                    +"GWZUAB1= :GWZUAB1,"
                    +"GWZUABART1= :GWZUABART1,"
                    +"GWBZGRS1= :GWBZGRS1,"
                    +"GWAPKZVH1= :GWAPKZVH1,"
                    +"GWWERTVH1= :GWWERTVH1,"
                    +"GWAPKZAK1= :GWAPKZAK1,"
                    +"GWWERTAK1= :GWWERTAK1,"
                    +"GWAPKZKU1= :GWAPKZKU1,"
                    +"GWWERTKU1= :GWWERTKU1,"
                    +"GWZENSUR2= :GWZENSUR2,"
                    +"GWMRKM2= :GWMRKM2,"
                    +"GWZUAB2= :GWZUAB2,"
                    +"GWZUABART2= :GWZUABART2,"
                    +"GWBZGRS2= :GWBZGRS2,"
                    +"GWAPKZVH2= :GWAPKZVH2,"
                    +"GWWERTVH2= :GWWERTVH2,"
                    +"GWAPKZAK2= :GWAPKZAK2,"
                    +"GWWERTAK2= :GWWERTAK2,"
                    +"GWAPKZKU2= :GWAPKZKU2,"
                    +"GWWERTKU2= :GWWERTKU2,"
                    +"GWZENSUR3= :GWZENSUR3,"
                    +"GWMRKM3= :GWMRKM3,"
                    +"GWZUAB3= :GWZUAB3,"
                    +"GWZUABART3= :GWZUABART3,"
                    +"GWBZGRS3= :GWBZGRS3,"
                    +"GWAPKZVH3= :GWAPKZVH3,"
                    +"GWWERTVH3= :GWWERTVH3,"
                    +"GWAPKZAK3= :GWAPKZAK3,"
                    +"GWWERTAK3= :GWWERTAK3,"
                    +"GWAPKZKU3= :GWAPKZKU3,"
                    +"GWWERTKU3= :GWWERTKU3,"
                    +"GWZENSUR4= :GWZENSUR4,"
                    +"GWMRKM4= :GWMRKM4,"
                    +"GWZUAB4= :GWZUAB4,"
                    +"GWZUABART4= :GWZUABART4,"
                    +"GWBZGRS4= :GWBZGRS4,"
                    +"GWAPKZVH4= :GWAPKZVH4,"
                    +"GWWERTVH4= :GWWERTVH4,"
                    +"GWAPKZAK4= :GWAPKZAK4,"
                    +"GWWERTAK4= :GWWERTAK4,"
                    +"GWAPKZKU4= :GWAPKZKU4,"
                    +"GWWERTKU4= :GWWERTKU4,"
                    +"GWZENSUR5= :GWZENSUR5,"
                    +"GWMRKM5= :GWMRKM5,"
                    +"GWZUAB5= :GWZUAB5,"
                    +"GWZUABART5= :GWZUABART5,"
                    +"GWBZGRS5= :GWBZGRS5,"
                    +"GWAPKZVH5= :GWAPKZVH5,"
                    +"GWWERTVH5= :GWWERTVH5,"
                    +"GWAPKZAK5= :GWAPKZAK5,"
                    +"GWWERTAK5= :GWWERTAK5,"
                    +"GWAPKZKU5= :GWAPKZKU5,"
                    +"GWWERTKU5= :GWWERTKU5,"
                    +"GWZENSUR6= :GWZENSUR6,"
                    +"GWMRKM6= :GWMRKM6,"
                    +"GWZUAB6= :GWZUAB6,"
                    +"GWZUABART6= :GWZUABART6,"
                    +"GWBZGRS6= :GWBZGRS6,"
                    +"GWAPKZVH6= :GWAPKZVH6,"
                    +"GWWERTVH6= :GWWERTVH6,"
                    +"GWAPKZAK6= :GWAPKZAK6,"
                    +"GWWERTAK6= :GWWERTAK6,"
                    +"GWAPKZKU6= :GWAPKZKU6,"
                    +"GWWERTKU6= :GWWERTKU6,"
                    +"GWAENDZL= :GWAENDZL,"
                    +"GWAENDBEN= :GWAENDBEN,"
                    +"GWAENDDAT= :GWAENDDAT,"
                    +"GWNEUBEN= :GWNEUBEN,"
                    +"GWNEUDAT= :GWNEUDAT,"
                    +"GWFILLER= :GWFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("GWMANDANT", OracleType.NVarChar).Value = dwData["GWMANDANT"].ToString(); 
          or1.Parameters.Add("GWPART", OracleType.NVarChar).Value = dwData["GWPART"].ToString(); 
          or1.Parameters.Add("GWLO", OracleType.NVarChar).Value = dwData["GWLO"].ToString(); 
          or1.Parameters.Add("GWBART", OracleType.NVarChar).Value = dwData["GWBART"].ToString(); 
          or1.Parameters.Add("GWBVAR", OracleType.NVarChar).Value = dwData["GWBVAR"].ToString(); 
          or1.Parameters.Add("GWBFARBE", OracleType.NVarChar).Value = dwData["GWBFARBE"].ToString(); 
          or1.Parameters.Add("GWVART", OracleType.NVarChar).Value = dwData["GWVART"].ToString(); 
          or1.Parameters.Add("GWVVAR", OracleType.NVarChar).Value = dwData["GWVVAR"].ToString(); 
          or1.Parameters.Add("GWVFARBE", OracleType.NVarChar).Value = dwData["GWVFARBE"].ToString(); 
          or1.Parameters.Add("GWEART", OracleType.NVarChar).Value = dwData["GWEART"].ToString(); 
          or1.Parameters.Add("GWEVAR", OracleType.NVarChar).Value = dwData["GWEVAR"].ToString(); 
          or1.Parameters.Add("GWEFARBE", OracleType.NVarChar).Value = dwData["GWEFARBE"].ToString(); 
          or1.Parameters.Add("GWPRVH", OracleType.NVarChar).Value = dwData["GWPRVH"].ToString(); 
          or1.Parameters.Add("GWPRAK", OracleType.NVarChar).Value = dwData["GWPRAK"].ToString(); 
          or1.Parameters.Add("GWPRKU", OracleType.NVarChar).Value = dwData["GWPRKU"].ToString(); 
          or1.Parameters.Add("GWZENSUR1", OracleType.NVarChar).Value = dwData["GWZENSUR1"].ToString(); 
          or1.Parameters.Add("GWMRKM1", OracleType.NVarChar).Value = dwData["GWMRKM1"].ToString(); 
          or1.Parameters.Add("GWZUAB1", OracleType.NVarChar).Value = dwData["GWZUAB1"].ToString(); 
          or1.Parameters.Add("GWZUABART1", OracleType.NVarChar).Value = dwData["GWZUABART1"].ToString(); 
          or1.Parameters.Add("GWBZGRS1", OracleType.NVarChar).Value = dwData["GWBZGRS1"].ToString(); 
          or1.Parameters.Add("GWAPKZVH1", OracleType.NVarChar).Value = dwData["GWAPKZVH1"].ToString(); 
          or1.Parameters.Add("GWWERTVH1", OracleType.NVarChar).Value = dwData["GWWERTVH1"].ToString(); 
          or1.Parameters.Add("GWAPKZAK1", OracleType.NVarChar).Value = dwData["GWAPKZAK1"].ToString(); 
          or1.Parameters.Add("GWWERTAK1", OracleType.NVarChar).Value = dwData["GWWERTAK1"].ToString(); 
          or1.Parameters.Add("GWAPKZKU1", OracleType.NVarChar).Value = dwData["GWAPKZKU1"].ToString(); 
          or1.Parameters.Add("GWWERTKU1", OracleType.NVarChar).Value = dwData["GWWERTKU1"].ToString(); 
          or1.Parameters.Add("GWZENSUR2", OracleType.NVarChar).Value = dwData["GWZENSUR2"].ToString(); 
          or1.Parameters.Add("GWMRKM2", OracleType.NVarChar).Value = dwData["GWMRKM2"].ToString(); 
          or1.Parameters.Add("GWZUAB2", OracleType.NVarChar).Value = dwData["GWZUAB2"].ToString(); 
          or1.Parameters.Add("GWZUABART2", OracleType.NVarChar).Value = dwData["GWZUABART2"].ToString(); 
          or1.Parameters.Add("GWBZGRS2", OracleType.NVarChar).Value = dwData["GWBZGRS2"].ToString(); 
          or1.Parameters.Add("GWAPKZVH2", OracleType.NVarChar).Value = dwData["GWAPKZVH2"].ToString(); 
          or1.Parameters.Add("GWWERTVH2", OracleType.NVarChar).Value = dwData["GWWERTVH2"].ToString(); 
          or1.Parameters.Add("GWAPKZAK2", OracleType.NVarChar).Value = dwData["GWAPKZAK2"].ToString(); 
          or1.Parameters.Add("GWWERTAK2", OracleType.NVarChar).Value = dwData["GWWERTAK2"].ToString(); 
          or1.Parameters.Add("GWAPKZKU2", OracleType.NVarChar).Value = dwData["GWAPKZKU2"].ToString(); 
          or1.Parameters.Add("GWWERTKU2", OracleType.NVarChar).Value = dwData["GWWERTKU2"].ToString(); 
          or1.Parameters.Add("GWZENSUR3", OracleType.NVarChar).Value = dwData["GWZENSUR3"].ToString(); 
          or1.Parameters.Add("GWMRKM3", OracleType.NVarChar).Value = dwData["GWMRKM3"].ToString(); 
          or1.Parameters.Add("GWZUAB3", OracleType.NVarChar).Value = dwData["GWZUAB3"].ToString(); 
          or1.Parameters.Add("GWZUABART3", OracleType.NVarChar).Value = dwData["GWZUABART3"].ToString(); 
          or1.Parameters.Add("GWBZGRS3", OracleType.NVarChar).Value = dwData["GWBZGRS3"].ToString(); 
          or1.Parameters.Add("GWAPKZVH3", OracleType.NVarChar).Value = dwData["GWAPKZVH3"].ToString(); 
          or1.Parameters.Add("GWWERTVH3", OracleType.NVarChar).Value = dwData["GWWERTVH3"].ToString(); 
          or1.Parameters.Add("GWAPKZAK3", OracleType.NVarChar).Value = dwData["GWAPKZAK3"].ToString(); 
          or1.Parameters.Add("GWWERTAK3", OracleType.NVarChar).Value = dwData["GWWERTAK3"].ToString(); 
          or1.Parameters.Add("GWAPKZKU3", OracleType.NVarChar).Value = dwData["GWAPKZKU3"].ToString(); 
          or1.Parameters.Add("GWWERTKU3", OracleType.NVarChar).Value = dwData["GWWERTKU3"].ToString(); 
          or1.Parameters.Add("GWZENSUR4", OracleType.NVarChar).Value = dwData["GWZENSUR4"].ToString(); 
          or1.Parameters.Add("GWMRKM4", OracleType.NVarChar).Value = dwData["GWMRKM4"].ToString(); 
          or1.Parameters.Add("GWZUAB4", OracleType.NVarChar).Value = dwData["GWZUAB4"].ToString(); 
          or1.Parameters.Add("GWZUABART4", OracleType.NVarChar).Value = dwData["GWZUABART4"].ToString(); 
          or1.Parameters.Add("GWBZGRS4", OracleType.NVarChar).Value = dwData["GWBZGRS4"].ToString(); 
          or1.Parameters.Add("GWAPKZVH4", OracleType.NVarChar).Value = dwData["GWAPKZVH4"].ToString(); 
          or1.Parameters.Add("GWWERTVH4", OracleType.NVarChar).Value = dwData["GWWERTVH4"].ToString(); 
          or1.Parameters.Add("GWAPKZAK4", OracleType.NVarChar).Value = dwData["GWAPKZAK4"].ToString(); 
          or1.Parameters.Add("GWWERTAK4", OracleType.NVarChar).Value = dwData["GWWERTAK4"].ToString(); 
          or1.Parameters.Add("GWAPKZKU4", OracleType.NVarChar).Value = dwData["GWAPKZKU4"].ToString(); 
          or1.Parameters.Add("GWWERTKU4", OracleType.NVarChar).Value = dwData["GWWERTKU4"].ToString(); 
          or1.Parameters.Add("GWZENSUR5", OracleType.NVarChar).Value = dwData["GWZENSUR5"].ToString(); 
          or1.Parameters.Add("GWMRKM5", OracleType.NVarChar).Value = dwData["GWMRKM5"].ToString(); 
          or1.Parameters.Add("GWZUAB5", OracleType.NVarChar).Value = dwData["GWZUAB5"].ToString(); 
          or1.Parameters.Add("GWZUABART5", OracleType.NVarChar).Value = dwData["GWZUABART5"].ToString(); 
          or1.Parameters.Add("GWBZGRS5", OracleType.NVarChar).Value = dwData["GWBZGRS5"].ToString(); 
          or1.Parameters.Add("GWAPKZVH5", OracleType.NVarChar).Value = dwData["GWAPKZVH5"].ToString(); 
          or1.Parameters.Add("GWWERTVH5", OracleType.NVarChar).Value = dwData["GWWERTVH5"].ToString(); 
          or1.Parameters.Add("GWAPKZAK5", OracleType.NVarChar).Value = dwData["GWAPKZAK5"].ToString(); 
          or1.Parameters.Add("GWWERTAK5", OracleType.NVarChar).Value = dwData["GWWERTAK5"].ToString(); 
          or1.Parameters.Add("GWAPKZKU5", OracleType.NVarChar).Value = dwData["GWAPKZKU5"].ToString(); 
          or1.Parameters.Add("GWWERTKU5", OracleType.NVarChar).Value = dwData["GWWERTKU5"].ToString(); 
          or1.Parameters.Add("GWZENSUR6", OracleType.NVarChar).Value = dwData["GWZENSUR6"].ToString(); 
          or1.Parameters.Add("GWMRKM6", OracleType.NVarChar).Value = dwData["GWMRKM6"].ToString(); 
          or1.Parameters.Add("GWZUAB6", OracleType.NVarChar).Value = dwData["GWZUAB6"].ToString(); 
          or1.Parameters.Add("GWZUABART6", OracleType.NVarChar).Value = dwData["GWZUABART6"].ToString(); 
          or1.Parameters.Add("GWBZGRS6", OracleType.NVarChar).Value = dwData["GWBZGRS6"].ToString(); 
          or1.Parameters.Add("GWAPKZVH6", OracleType.NVarChar).Value = dwData["GWAPKZVH6"].ToString(); 
          or1.Parameters.Add("GWWERTVH6", OracleType.NVarChar).Value = dwData["GWWERTVH6"].ToString(); 
          or1.Parameters.Add("GWAPKZAK6", OracleType.NVarChar).Value = dwData["GWAPKZAK6"].ToString(); 
          or1.Parameters.Add("GWWERTAK6", OracleType.NVarChar).Value = dwData["GWWERTAK6"].ToString(); 
          or1.Parameters.Add("GWAPKZKU6", OracleType.NVarChar).Value = dwData["GWAPKZKU6"].ToString(); 
          or1.Parameters.Add("GWWERTKU6", OracleType.NVarChar).Value = dwData["GWWERTKU6"].ToString(); 
          or1.Parameters.Add("GWAENDZL", OracleType.NVarChar).Value = dwData["GWAENDZL"].ToString(); 
          or1.Parameters.Add("GWAENDBEN", OracleType.NVarChar).Value = dwData["GWAENDBEN"].ToString(); 
          or1.Parameters.Add("GWAENDDAT", OracleType.NVarChar).Value = dwData["GWAENDDAT"].ToString(); 
          or1.Parameters.Add("GWNEUBEN", OracleType.NVarChar).Value = dwData["GWNEUBEN"].ToString(); 
          or1.Parameters.Add("GWNEUDAT", OracleType.NVarChar).Value = dwData["GWNEUDAT"].ToString(); 
          or1.Parameters.Add("GWFILLER", OracleType.NVarChar).Value = dwData["GWFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
